<?php

namespace App\Exceptions;

class SponsorException extends BaseException
{
    const CODE_1001 = 1001;
    const CODE_1002 = 1002;
    const CODE_1003 = 1003;
    const CODE_1004 = 1004;
    const CODE_1005 = 1005;
    const CODE_1006 = 1006;
    const CODE_1007 = 1007;
    const CODE_1008 = 1008;
    const CODE_1009 = 1009;
    const CODE_1010 = 1010;

    const CODE_2001 = 2001;
    const CODE_2002 = 2002;
    const CODE_2003 = 2003;

    const CODE_3001 = 3001;

    const CODE_4001 = 4001;

    const CODE_5001 = 5001;
    const CODE_5002 = 5002;

    const CODE_6001 = 6001;

    protected int $baseCode = self::BASE_CODE_OF_SPONSOR;    //

    protected array $showMsg = [
        self::CODE_1001 => '商品不存在',
        self::CODE_1002 => '剩余积分不足',
        self::CODE_1003 => '认养订单不存在',
        self::CODE_1004 => '购物车数据刷新，请刷新后重试',
        self::CODE_1005 => '商品失效，请刷新后重试',
        self::CODE_1006 => '已上架的商品不能删除',
        self::CODE_1007 => '商品已下架',
        self::CODE_1008 => '商品库存不足',
        self::CODE_1009 => '状态不允许操作',
        self::CODE_1010 => '使用积分不能超过商品本身价格',

        self::CODE_2001 => '分类已存在',
        self::CODE_2002 => '分类不存在',
        self::CODE_2003 => '分类已被使用，不能删除',

        self::CODE_3001 => '地区不存在',

        self::CODE_4001 => '用户认养记录不存在',

        self::CODE_5001 => '用户申请记录不存在',
        self::CODE_5002 => '申请已提交，请耐心等候',

        self::CODE_6001 => '操作频繁，请稍后重试'
    ];

    function __construct($msg = '', $code = 0)
    {
        parent::__construct($msg, $code);
    }
}
